The following code demonstrates the use of the PEExportOptions structure and the PEExportTo function to specify an export destination and format for a report. Use PEExportTo as an alternative to PEOutputToWindow and PEOutputToPrinter. In this example, the specified report is exported to a disk file in Character Separated Values format:
// Note: UXFSEPV.H and UXDDISK.H must be #included
// for this example to work. Refer to the
// PEExportTo function and the
// PEExportOptions structure for more information. struct UXFCharSeparatedOptions charSepOptions;
// For formatOptions struct UXDDiskOptions diskOptions;
// For destinationOptions struct PEExportOptions exportOptions; // Initialize members of charSepOptions
charSepOptions.structSize = UXFCharSeparatedOptionsSize; // Use number format saved in report
charSepOptions.useReportNumberFormat = TRUE; // Do not use date format saved in report
charSepOptions.useReportDateFormat = FALSE; // No quotes around values
charSepOptions.stringDelimeter = '^'; // Character separator is *
charSepOptions.fieldDelimeter = "*"; // Initialize members of diskOptions
diskOptions.structSize = UXDDiskOptionsSize;
diskOptions.fileName = "c:\reports\myreport.rpt"; // Initialize members of exportOptions
exportOptions.StructSize = PE_SIZEOF_EXPORT_OPTIONS;
lstrcpy(exportOptions.formatDLLName, "uxfsepv.dll");
exportOptions.formatType = UXFCharSeparatedType;
exportOptions.formatOptions = &charSepOptions;
lstrcpy(exportOptions.destinationDLLName, "uxddisk.dll");
exportOptions.destinationType = UXDDiskType;
exportOptions.destinationOptions = &diskOptions; if (!PEExportTo(Job, &exportOptions)) {
// Handle error }
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |